package com.hnkj.caiyunweather.logic.network

import com.hnkj.caiyunweather.WeathrerApplication
import com.hnkj.caiyunweather.logic.model.PlaceResponse
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Query

interface PlaceService {
    //调用该方法的时候,Retrofit就会自动发送一条GET请求，去访问@GET注解中配置的地址,同时返回值被声明成了
    //Call<PlaceResponse>，这样Retrofit就会将服务器返回的JSON数据自动解析成沃恩定义的PlaceResponse对象
    @GET("v2/place?&token=${WeathrerApplication.TOKEN}&lang=zh_CN")
    fun searchPlaces(@Query("query")placeName: String):Call<PlaceResponse>
}